Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EPMGCIP-179: Configure linters #31

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Conversation

Dzmitry-Yaniuk
Copy link
Collaborator

https://jira.epam.com/jira/browse/EPMGCIP-179

Code changes

  • Extended .gitignore to exclude MS and JetBrains IDE working settings;
  • Extended .eslint.json file with multiple rules ESLint rules for TypeScript, JavaScript and React;
  • Added .prettierignore file with folders to exclude some directories from checking for Prettier;
  • Added alias for messages folder in tsconfig.json;
  • Run linters fixes across all app files;

Notes

  • Would be great if there is a chance to double check this PR locally before merging to base branch;
  • Rules extending is welcomed!

@@ -1,5 +1,5 @@
const config = {
'*.{js,jsx,ts,tsx}': ['eslint --fix --max-warnings 100', 'prettier --write'],
'*.{js,jsx,ts,tsx}': ['eslint --fix --max-warnings 30', 'prettier --write'],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Dzmitry-Yaniuk
What do you think about decreasing warnings to '0'? It was '0' before switching to nextjs, so I guess we can try to continue doing that.

Copy link
Collaborator Author

@Dzmitry-Yaniuk Dzmitry-Yaniuk Dec 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea! From my opinion absence of warnings in code is a project good shape indicator.
However, with existing applied rules we get already around 10 warnings, refactoring code in terms of this PR might not be a good idea. Perhaps I can set this limit now to 20 items?

Otherwise code cannot be pushed without bypass option for git commit.

.eslintrc.json Outdated Show resolved Hide resolved
.eslintrc.json Outdated
"next/core-web-vitals",
"eslint:recommended",
"prettier",
"plugin:@typescript-eslint/recommended"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously we also used this plugins:

'plugin:jest/recommended',
'plugin:react-hooks/recommended',
'airbnb',
'airbnb/hooks',
'airbnb-typescript'

Maybe there is a sense to add them as well. What do you think about that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since there are existing eslint:recommended and prettier plugins I assume airbnb related plugins might be a little redundant (quite rules in common). What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants